<include file="Common@Backend/header" />
    <!-- page heading start-->
    <div class="page-heading">
        <h3>
            {$breadcrumb.A}
        </h3>
        <ul class="breadcrumb">
            <li>
                {$breadcrumb.M}
            </li>
            <li>
                {$breadcrumb.C}
            </li>
            <li class="active"> {$breadcrumb.A}  </li>
        </ul>
    </div>
    <!-- page heading end-->
    
    <!--body wrapper start-->
    <div class="wrapper">
        <div class="row">
            <form role="form" action="{$action}" method="post">
            <input type="hidden" name="id" value="{$id}" />
            <div class="col-lg-12">
                <section class="panel">
                    <header class="panel-heading">
                        角色资料
                    </header>
                    <div class="panel-body">
                        <div class="form-group">
                            <label for="name">角色名称</label>
                            <input type="text" name="name" class="form-control" id="name" placeholder="输入角色名称" value="{$role.name}">
                        </div>
                        <div class="form-group">
                            <label for="status">状态</label>
                            <select class="form-control m-bot15" id="status" name="status">
                            <if condition="$role.status eq 1">
                                <option value="1" selected="selected">启用</option>
                                <option value="0">关闭</option>
                            <else />
                                <option value="1">启用</option>
                                <option value="0" selected="selected">关闭</option>
                            </if>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="remark">备注</label>
                            <textarea class="form-control" rows="2" name="remark" id="remark">{$role.remark}</textarea>
                        </div>
                    </div>
                    <header class="panel-heading">
                        设置权限
                    </header>
                    <div class="panel-body">
                        <div class="form-group">
                            <ul class="list-unstyled">
                                <foreach name="nodeList" item="node">
                                    <li>
                                        <div class="col-sm-12 icheck ">
                                            <div class="child-box1">
                                                <div class="flat-red single-row bline">
                                                    <div class="radio ">
                                                        <if condition="in_array($node['id'],$accessIds)" >
                                                            <input type="checkbox" class="module" value="{$node.id}_{$node.level}_{$node.name}" name="nodes[]" checked />
                                                        <else />
                                                            <input type="checkbox" class="module" value="{$node.id}_{$node.level}_{$node.name}" name="nodes[]" />
                                                        </if>
                                                        <label>{$node.title}[{$node.name}]</label>
                                                    </div>
                                                </div>
                                                <notempty name="node.child">
                                                    <foreach name="node.child" item="child">
                                                        <div class="child-box2">
                                                            <div class="flat-blue single-row bline">
                                                                <div class="radio">
                                                                    <if condition="in_array($child['id'],$accessIds)" >
                                                                    <input type="checkbox" class="controller" value="{$child.id}_{$child.level}_{$node.name}" name="nodes[]" checked />
                                                                    <else />
                                                                    <input type="checkbox" class="controller" value="{$child.id}_{$child.level}_{$node.name}" name="nodes[]"/>
                                                                    </if>
                                                                    <label>{$child.title}[{$child.name}]</label>
                                                                </div>
                                                            </div>
                                                            <notempty name="child.child">
                                                                <div class="child-box3">
                                                                    <foreach name="child.child" item="child_child">
                                                                    <div class="flat-green">
                                                                        <div class="radio ">
                                                                            <if condition="in_array($child_child['id'],$accessIds)" >
                                                                            <if condition="$node.type eq 1" >
                                                                            <input type="checkbox" class="action" value="{$child_child.id}_{$child_child.level}_{$node.name}" name="nodes[]" checked/>
                                                                            <else/>
                                                                            <input type="checkbox" value="{$child_child.id}_{$child_child.level}_{$node.name}" name="nodes[]" checked/>
                                                                            </if>
                                                                            <else />
                                                                            <if condition="$node.type eq 1" >
                                                                            <input type="checkbox" class="action" value="{$child_child.id}_{$child_child.level}_{$node.name}" name="nodes[]" />
                                                                            <else/>
                                                                            <input type="checkbox" class="action" value="{$child_child.id}_{$child_child.level}_{$node.name}" name="nodes[]" />
                                                                            </if>
                                                                            </if>
                                                                            <label>{$child_child.title}[{$child_child.name}]</label>
                                                                        </div>
                                                                    </div>
                                                                    </foreach>
                                                                </div>
                                                            </notempty>
                                                        </div>
                                                    </foreach>
                                                </notempty>
                                            </div>
                                        </div>
                                    </li>
                                </foreach>
                            </ul>
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn-primary">保存</button>
                            <a href="{$cancel}" class="btn btn-primary">取消</a>
                        </div>
                    </div>
                </section>
            </div>
            </form>
        </div>
    </div>
    <!--body wrapper end-->
<include file="Common@Backend/footer" />